let fs = require('fs')

let str = fs.readFileSync('score.txt','utf8');      // '小明=98,小红=68,小黑=88,小绿=77,小王=59,小白=100'

let arr = str.split(',')

let sum = arr.reduce(function(pre,item){
    // console.log(item);          // '小明=98'
    // console.log(item.split('=')[1])
    return pre + item.split('=')[1]*1
},0)

console.log(sum);